@extends('main')

@section('tip', '所有分类')

@section('content')

<div class="row">
    <div class="col-md-9">
        <table class="table">
            <thead>
            <tr>
                <th>#</th>
                <th>分类名称</th>
            </tr>
            </thead>
            <tbody>
            @foreach($categories as $category)
                <tr>
                <td>{{ $category->id }}</td>
                <td>{{ $category->name }}</td>
                </tr>
            @endforeach
            </tbody>
        </table>
    </div>
    <div class="col-md-3">
    <div class="panel panel-default">
    <div class="panel-body">
        {!! Form::open(['route'=>'category.store', 'method'=>'POST']) !!}
        {!! Form::label('name', '分类名称:') !!}
        {!! Form::text('name', null, ['class'=>'form-control']) !!}
        {!! Form::submit('添加新的分类', ['class'=>'btn btn-primary btn-block', 'style'=>'margin-top:10px']) !!}
        {!! Form::close() !!}
        </div>
    </div>
    </div>
</div>

@endsection